import random

ls = [random.choice(range(20)) for i in range(20)]
count_ls = {}

for i in ls:
    if i in count_ls:
        count_ls[i] += 1
    else:
        count_ls[i] = 1

res = sorted(count_ls.items(), reverse=True, key=lambda item: item[1])[:3]

print(res)


# 完成的不错
